{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# seaborn.countplot()计数图、柱状图\n",
    "\n",
    "解析：\n",
    "使用条形图(柱状图)显示每个分类数据中的数量统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "seaborn.countplot(x=None, y=None, hue=None, \n",
    "                  data=None, order=None, hue_order=None, \n",
    "                  orient=None, color=None, palette=None,\n",
    "                  saturation=0.75, dodge=True, ax=None, **kwargs)\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "输入数据可以通过多种格式传递：  \n",
    "\n",
    "1. list、numpy数组、pandas\n",
    "\n",
    "2. long-form DataFrame\n",
    "\n",
    "3. wide-form DataFrame\n",
    "\n",
    "4. 在大多数情况下，可以使用numpy或Python对象，但推荐使用pandas对象，因为关联的名称将用于注释轴。此外，使用分类类型来分组变量来控制绘图元素的顺序。\n",
    "\n",
    "可选：  \n",
    "x,y,hue：数据变量的名称\n",
    "\n",
    "用于绘制数据的输入\n",
    "\n",
    "data: DataFrame,数组或数组列表\n",
    "\n",
    "用于绘图的数据集，如果x和y不存在，则将其解释为 wide-form,否则它被认为是 long-form \n",
    "\n",
    "order, hue_order:字符串列表\n",
    "\n",
    "指定绘制分类级别，否则从数据对象推断级别\n",
    "\n",
    "orient: v | h\n",
    "\n",
    "图的显示方向(垂直或水平,即横向或纵向)，这通常可以从输入变量的dtype推断得到\n",
    "\n",
    "palette：调色板名称,list列表，dict字典\n",
    "\n",
    "用于对变量调不同级别的颜色\n",
    "\n",
    "saturation(饱和度)：float\n",
    "\n",
    "用于绘制颜色的原始饱和度的比例，如果希望绘图颜色与输入颜色规格完美匹配，则将其设置为1\n",
    "\n",
    "dodge:bool\n",
    "\n",
    "使用色调嵌套时，是否应沿分类轴移动元素。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.4583</td>\n",
       "      <td>Q</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Queenstown</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>54.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>51.8625</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>E</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>21.0750</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>child</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   survived  pclass     sex   age  sibsp  parch     fare embarked  class  \\\n",
       "0         0       3    male  22.0      1      0   7.2500        S  Third   \n",
       "1         1       1  female  38.0      1      0  71.2833        C  First   \n",
       "2         1       3  female  26.0      0      0   7.9250        S  Third   \n",
       "3         1       1  female  35.0      1      0  53.1000        S  First   \n",
       "4         0       3    male  35.0      0      0   8.0500        S  Third   \n",
       "5         0       3    male   NaN      0      0   8.4583        Q  Third   \n",
       "6         0       1    male  54.0      0      0  51.8625        S  First   \n",
       "7         0       3    male   2.0      3      1  21.0750        S  Third   \n",
       "\n",
       "     who  adult_male deck  embark_town alive  alone  \n",
       "0    man        True  NaN  Southampton    no  False  \n",
       "1  woman       False    C    Cherbourg   yes  False  \n",
       "2  woman       False  NaN  Southampton   yes   True  \n",
       "3  woman       False    C  Southampton   yes  False  \n",
       "4    man        True  NaN  Southampton    no   True  \n",
       "5    man        True  NaN   Queenstown    no   True  \n",
       "6    man        True    E  Southampton    no   True  \n",
       "7  child       False  NaN  Southampton    no  False  "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "sns.set(style=\"darkgrid\")\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "titanic[:8]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGIZJREFUeJzt3XtwVPX9//HXSTZJKaAC7gqlmFZEQblXbl4SZYQkYBQCP01BIrYwQhVbhglDSRoHnTZAw1Ccimi/lN+U0QpCYiCETQo4eAkKRAtiQUEJbVK7WZJwCZDrnu8fft2KiHwSc7IrPB8zjDlnb+/lmDyz57BnLdu2bQEAYCAi1AMAAL47iAYAwBjRAAAYIxoAAGNEAwBgjGgAAIwRDQCAMaIBADBGNAAAxogGAMAY0QAAGCMaAABjRAMAYMwV6gHaSk3NGQUCnLAXAExERFjq0qVji2932UQjELCJBgA4jN1TAABjRAMAYIxoAACMEQ0AgDGiAQAwRjQAAMaIBgDA2GXzPg1Tna/6nr4XExXqMS57dfWNOn2qLtRjAGhjV1w0vhcTpSnzXwr1GJe9l5dO1WkRDeByw+4pAIAxogEAMEY0AADGiAYAwBjRAAAYIxoAAGNEAwBgjGgAAIwRDQCAMUffET5t2jRVV1fL5fr8YZ5++mn985//1PPPP6+mpiY98sgjmjp1qiSppKRE2dnZqq+vV1JSkubOnevkaACAVnAsGrZtq6ysTK+//nowGj6fT3PnzlVubq6io6OVmpqqESNG6Ic//KEWLlyotWvXqkePHn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AMAYIxoAACMEQ0AgDGiAQAwRjQAAMb+F5FUbGj0Ktv6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例1： 显示单个分类变量的值统计数\n",
    "\"\"\"\n",
    "sns.countplot(x=\"who\", data=titanic)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XtcVHX+x/HXwADeKNFmxJ+5VGqLWaJpCpVQaWAiq6Fb3kLtZ1qplZX+FFlT29TUHqbbzdK8ZVusd03RMrM1NJNSZMO2i1hegvGGUDIwzPz+cHdWV6wDMRfh/Xw8eDyYM2fO9zMzMO853/M932NyuVwuREREDAjwdQEiInL5UGiIiIhhCg0RETFMoSEiIoYpNERExDCFhoiIGKbQEBERwxQaIiJimEJDREQMU2iIiIhhCg0RETFMoSEiIoYpNERExDCzrwuoLqdO/YTTqQl7RUSMCAgwERZWv9KPqzGh4XS6FBoiIh6m7ikRETFMoSEiIobVmO6pirhcLk6dslFaWgKo66piJoKD6xAWZsFkMvm6GBHxczU6NIqLCzGZTDRpcjUmk3aqKuJyOTl9+jjFxYWEhjb0dTki4udq9Cfp2bPFhIY2VGD8ApMpgNDQMM6eLfZ1KSJyGajRn6ZOZzmBgTV6Z6paBAaacTrL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wczcOBAX5QmIlItgs1BDFn0uNfbXTx0LlCDQsPlcpGXl8e2bdvcoZGfn8+YMWNYtWoVwcHB9OvXj86dO9OyZUtvlyciIr/A66Hx3XffAfDggw9y+vRp7rvvPurXr090dDQNGzYEICEhgYyMDEaNGuXt8kRE5Bd4/UD4mTNniImJ4eWXX2bx4sW88847HD16FIvF4l7HarWSn5/v7dJERORXeH1Po3379rRv3959u2/fvkyfPp1HHnnEvczlcmEymSq13caNG1RbjTWNLw7GSfXQeydV4cm/G6+Hxp49eygrKyMmJgY4FxDNmjXDZrO517HZbFit1kpt98SJYpxO16+uVxv/CW22Il+XUG1q2/un906qwsjfTUCAqUpftr3ePVVUVMTMmTOx2+0UFxezevVqZs2axc6dOzl58iRnz55ly5YtxMbGers0ERH5FV7f07jzzjvZt28fvXv3xul0MmDAADp06MCYMWNISUmhrKyMvn370rZtW2+XJiIiv8In52k88cQTPPHEExcsS0pKIikpyRfliIiIQZpGREREDFNoiIiIYQoNERExTKEhIiKGKTRERMQwhYaIiBim0BAREcMUGiIiYphCQ0REDFNoiIiIYQoNERExTKEhIiKGKTRERMQwhYaIiBim0BAREcN8cj0NEfl1pY4yn1wi1V5ayplCu9fblcuDQkPETwWbgxiy6HGvt7t46FxAoSEVU/eUiIgYptAQERHDFBoiImKYQkNERAxTaIiIiGEKDRERMUxDbms4jfUXkerkV6Gxfv16Xn31VRwOB4MHD2bgwIG+Lumyp7H+IlKd/CY08vPzmTNnDqtWrSI4OJh+/frRuXNnWrZs6evSRETkX/wmNDIzM4mOjqZhw4YAJCQkkJGRwahRoww9PiDAZLitq8LqV6nG3yr4isY+afeqBo180m5l3pPKqE3vn9676qH/vaqtUxGTy+VyVemR1Wz+/Pn8/PPPjBkzBoC//e1vZGdn8+yzz/q4MhER+Te/GT3ldDoxmf6TfC6X64LbIiLie34TGuHh4dhsNvdtm82G1Wr1YUUiIvLf/CY0br31Vnbu3MnJkyc5e/YsW7ZsITY21tdliYjIefzmQHiTJk0YM2YMKSkplJWV0bdvX9q2bevrskRE5Dx+cyBcRET8n990T4mIiP9TaIiIiGEKDRERMUyhISIihvnN6Kna6PDhw3Tv3p0WLVpcsPyGG26gW7dudO3a1dB2JkyYwKhRo2jWrJknyqy1MjIyeP3113E4HLhcLnr16sWwYcO8WsOqVavYvXs3M2bM8Gq7NdWUKVP4/PPPKSsr4/vvv3f/7505c4bk5GRGjx59wfpbt24lJyeHxx//5Uk///KXvwBc9PiaSKHhY1arlbVr1/6mbXz66aeMHDmymioSODeB5vPPP8+qVasICwvjp59+4oEHHuDaa681HObif5555hng3Be2lJQU9//evz/0/1vXrl31fv8XhYYfGj9+PJ06daJTp04MGzaMsLAw6tSpw//93/8xadIkHA4HISEhTJ8+nS1btlBQUMDw4cNZvnw5YWFhvi6/Rjh16hRlZWWUlJQAUL9+fWbMmEFISAjZ2dlMnz6dkpISwsLCmDJlCs2bNyc3N5dJkyZRUlLClVdeyezZswkPD+e1115j3bp1BAYGcttttzF27FiOHTvGqFGjaNWqFbm5uTRu3Ji5c+fSsGFD1qxZw6uvvkqDBg1o1qwZ9erV8/GrUTtkZ2fTr18/8vPz3Xsd5+/p3XXXXbRt25bc3FzefvttVq9eTXp6OmFhYVxxxRW15rwyHdPwsYKCAnr16uX+WbBgwQX3Hzx4kFmzZrFo0SKWLFnC0KFDWbVqFffddx979+5l+PDhWK1WXn/9dQVGNYqMjKRr165069aNvn37MmvWLJxOJ02bNiUtLY0XXniB1atXM3ToUP70pz8B8PTTT/Poo4+yfv16evTowZIlS9i+fTsffvghK1euZPXq1Rw6dIh33nkHgAMHDjB06FA2bNjAFVdcwfr168nPz2f27NksX76cd999l59++smXL0OtcuLECZYuXcrKlStZuHAhxcXFF60TGxvL5s2bOXr0qPs9XbRoET/++KMPKvYN7Wn4WEXdU+PHj3f/3rhxY66++moA4uLimDp1Kn//+9+56667uPPOO71aa20zZcoUHn30UXbs2MGOHTu47777GD58OD/88AOPPPKIe73i4mJOnjyJzWZzvycDBgwA4PnnnycxMZG6des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z/TpEkTIiMjuffee4mNjSU2NpaYmBicTmeFy0X8mUJDxKDAwMALZrItKSnhu+++c99+8sknKS8v55577uGOO+7g2LFjuFwuAgICeOutt9i/fz87d+5k2rRpdOnShXHjxl1yuYi/0oFwEYM6d+7Mzp07KSgoAOCdd95h1qxZ7vt37NjByJEj6dGjBwD79u2jvLycAwcO0LNnT1q0aMGIESMYMmQI+/fvv+RyEX+mPQ0Rg37/+98zduxYhg0bBoDFYmHKlCnMnz8fgDFjxjBy5Ejq1atHgwYNuOWWW/j+++/54x//yD333EOfPn2oV68ederUIS0tjcjIyAqXi/gzzXIrIiKGqXtKREQMU2iIiIhhCg0RETFMoSEiIoYpNERExDCFhoiIGKbQEBERwxQaIiJi2P8Dg0DhvQDpK+EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例2：显示多个分类变量的值统计数\n",
    "\"\"\"\n",
    "sns.countplot(x=\"class\", hue=\"who\", data=titanic)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAEPCAYAAAAEfBBiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHopJREFUeJzt3X98zvX+x/HndW02P7bY1tDBUYmzJBJn+ZmY5scMoZKYWX3lFP04SXOOQr8w61ZyzkmdKZQOHTNMRKlExJdiZPqqKI7ZL8PGflzXrs/3jzoLDcN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CslQ5iM1D2upMlI6cOznN3HkSM/qmHDpgYrujTljYKrauW9V3a7TSEhARd9LI8ehAAApgTV9ZOvn3+lH9dZUqy84yWVflxvRAABQDl8/fy1PeHBSj9uuwlJkgggiQACAI8SE3Ovnntuuq699jpNmfJXBQQEaPz4idq9O03z58/VzTe30dq1q2W323XbbR01Zsw4ZWVlauLE8WratKn27/9BLVqEqVWr1lq9eqXy80/opZcSde211+mTTz7WokXvqri4WA5HiSZOfFY339xGY8eOVsuWN2nnzh06dixPjz/+lDp27FzlvVabQQgAUB107NhF27dvlST98MN3SkvbIUnasmWzOnXqqo0bP1dS0jt6662FOnTooJYtS5Ykff/9Pt1//0jNm/cv7dq1U0eOZOiNN95Wz569tGLFUrlcLi1fnqyEhFc1f/6/NGxYjN55Z17ZeR0Op954422NG/dn/fOfr7ulVwIIADxIx46dtW3b/2r//h903XXXy273UV7eUX355RdKT/9GPXv2Us2aNeXr66vo6AHavv1/JUnBwSFq0SJMdrtdoaH11a7dHyVJDRteo/z8fNntdr300kxt3bpZSUlztHr1ShUWnio77223dZT08zIQ+fkn3NIrt+DKcfOYGb95rcTpkJ9v5a8PfyVzlhSbLgHwOK1atdaLL07Vtm1b1bZtOwUFhejTT9fJ6XQqMDDwjG0ty1JpqVOSVKPGmf8+nb58gySdOnVK//M/IxUZ2Udt2rRVs2Y3nLGI3X+XcLDZbG5bwoEAKsf4f09VTsHRM16bN2qWVw0/rS7DZYErja+vr1q2bKklSxYpIeFVhYRcrZdfnqE+ffqpVavWmj9/rgYMuEs+Pr5auXJFhScbPXjwJ9lsNsXExMmyLD3//LNyudw7hPtsBBAAeJiOHbtox46v1LTptQoODlFe3lF17txVrVq11r593+qBB2JUWurUbbd11ODB9yo7O+uCx7zhhua64YYWGjZsiOx2m8LDO5Z9v2QKP0QtB5+APAd9eJbq2kd5P670ht8B8UNUAKiGfg4Jfq9TlRgFBwAwggACABhBAAEAjCCAAABGEEAAACMIIACAEQzDBoByXFXXX/6/TE9TmYpLSnTi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233abNmzcrKytLkrRo0SKtX79eq1atKhu1lpycrHr16qlp06YKCgrS7t27JUmZmZnaunVrhc7j4+Mjp9NZNU0AlYDvgAA3+8Mf/qCnnnpKDz74oKSfV6/86KOP9PHHH2vkyJFyuVwKDg7WG2+8IbvdrhEjRmj8+PHq1auXGjdurA4dOlToPL1799aIESM0e/ZstWjRoipbAi4Js2EDAIzgFhwAwAgCCABgBAEEADCCAAIAGEEAAQCMIIAAAEYQQAAAIwggAIAR/w9UfXzAZiskbQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例3： 水平横向绘制条形图\n",
    "\"\"\"\n",
    "sns.countplot(y=\"class\", hue=\"who\", data=titanic)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGHxJREFUeJzt3X90THce//HXzc+vRevHzmCtZrco6retX60m6iAJTUs4ZYtUdzllW3YdJz1Wsnq0ZzfY5Fg9S7V7rHPq27OliBAMix5KtIgu1aWlFbvJ2skkEQSJJHO/f/Tb2aqqT9LczJTn4xynuXdm7rzHbfLM3GtmLNu2bQEAYCAs2AMAAL4/iAYAwBjRAAAYIxoAAGNEAwBgjGgAAIwRDQCAMaIBADBGNAAAxogGAMAY0QAAGCMaAABjRAMAYCwi2AM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qu3bt1KRJE7Vs2VKDBw+WJP3oRz/SpUuXlJWVpa1btyorK0vvvvuurl69Grjto48+Kknq3LmzysvLgzL/nezLaJw5c0adOnVSWFiYSktLtW/fPn300UcaPXq0mjRpooiICI0bNy4QmB/+8Id68MEHFRYWprZt2960T8PCwrR8+XLt379fy5YtU3Z2tq5cuRK4X/arsw4fPqzExERFRUWpadOmysnJkcvl0vDhwyVJnTp10oULF255+0OHDikxMVGS9MQTTygyMrJR5g4VRCPIvv4/XHh4eODr8+fPa8KECbp8+bJiY2M1duxYffUF/NHRX3wuAe8G7Iy+ffvq1KlTysvL04ABA9S/f395PB7V1NTonnvuuen6NTU1kqSoqKgb1n91n0rSlStXNH78eBUWFqp///6aMmXKDZezX50VERFxw99tYWGhrl69GthPJn/vX34fWpalsLC768fo3fVov2c++ugjxcTEaOrUqerZs6d27dql2traYI9114iIiFCvXr20Zs0aDRgwQIMGDdLKlSsVFxenQYMGaevWraqsrFRNTY02bNigQYMGGW23oKBAlmVpxowZGjhwoP7+97+zXxtR//79tXPnTlVXV+vatWuaNm2avF6v8e0ffvhhbd68WZK0c+dOVVVVOTVqSOJEeAgbMmSITp06pVGjRsm2bfXv31+nT58O9lh3lbi4OB0+fFgdO3aUy+VSaWmphg4dqr59++rkyZMaN26campqNGTIEE2ePFn//e9/b7vNrl27qlu3bkpMTJRlWRoyZIjy8/Mb4dFAkkaMGKETJ04oOTlZfr9fKSkp2r59u/HtFyxYoNTUVK1du1Y9evRQ06Z31yeB8oaFAABjHJ4CABgjGgAAY0QDAGCMaAAAjBENAIAxogE4YN68eVq1alWwxwAaHNEAABgjGkA9PPnkk4H3msrNzVXPnj1VWVkpSUpLS9O+ffv04YcfauLEiRo+fLhmzpwZeN+wI0eO6KmnnlJSUpKSk5O1b9++oD0OoK6IBlAPI0aMCPywf++993TvvffqyJEjsm1be/fuVbdu3eT1erV69Wrt2LFDXq9XO3fu1IULFzR79mylpaVpy5YtWrx4sVJTU/Xvf/87yI8IMEM0gHr4Mhq2bevIkSOaOnWqDhw4oH/84x+67777Au+a2qRJE4WHh6tz584qKyvT8ePHdd999wU+h6Fz587q16+fDh06FORHBJghGkA9dOnSRdXV1dq9e7d+8pOf6LHHHtOBAwe0Z88excfHS/riDQ+/ZFmWbNtWbW3tTe+iatt24B1ygVBHNIB6Gj58uLKysvTII4+oY8eOqqio0JYtWzRy5Mhb3qZPnz76/PPPdfz4cUnS6dOndfjw4Rs+GQ4IZbzLLVBPI0aM0KpVq/Twww9L+uItsz/55BO1a9fulrdp1aqVli1bpldeeUWVlZWyLEsZGRn66U9/2lhjA98J73ILADDG4SkAgDGiAQAwRjQAAMaIBgDAGNEAABgjGgAAY0QDAGCMaAAAjP0/AfxpT3YdGXYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例4： 使用不同调色板\n",
    "\"\"\"\n",
    "sns.countplot(x=\"who\", data=titanic, palette=\"Set2\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAEUCAYAAADz1+WaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XtUVXX+//HnkasKJulBzRxXqWVmXkdFJSjMK5AJeA/FvqaV+i2/Doy30VEnxdtytJzKclljOuooiGKSWuZkmBrmrbBvfRMbvADe8IIgB/bvD1fnJ6PVATlnc3k91mot9oe993nv4ydeZ1/O52MxDMNAREREXKqG2QWIiIhURwpgEREREyiARURETKAAFhERMYECWERExAQKYBERERMogKuBf/zjH6xYsaJc9nXs2DFCQkLuaR83btxg0qRJ9O3bl969e7Nr165yqU2kovX1n504cYLAwMBy2ZdUHe5mFyDON3ToULNLKOGNN96gVq1abN++nTNnzjB48GBat25Nw4YNzS5NKrmK1tdtNhsffvgh7777Lnl5eWaXIxWMAriCuH79OlOmTOHUqVPUqFGDxx9/nNmzZ3Pw4EHmzJlDcnIyAPv377cvv/HGGxw+fJjs7GxatGhBWloay5cvp3Xr1gC89tprdO7cmQsXLnDp0iVCQkKYP38+W7duBeDKlSv06NGDXbt2kZ+fz+zZszl79iyFhYWEhoby0ksvAbB27Vo++OADfHx8eOSRR+5a/w8//MCkSZPuaB8xYgSRkZEl2nbt2sWiRYsAeOCBB+jevTvbt29n1KhR5fNmSoVWnfr6t99+y3fffcebb77JCy+8UG7voVQNCuAKYufOnVy/fp2kpCSKioqYOXMm//73v39zu9OnT5OcnIy7uzvLli0jISGB1q1bk5uby759+5gzZw7vv/8+AN27d+f69escO3aMJ554guTkZIKDg7nvvvuYMGECMTExhISEUFBQwIsvvsjvfvc7HnroId58802SkpKwWq3MmDHjrnU0b96cpKQkh4717NmzNGrUyL7coEEDzp0759C2UvlVp77epk0b2rRpQ2ZmpsPvj1QfCuAKomPHjixZsoTo6Gi6devGyJEjadq06W8GU7t27XB3v/XPGBkZSVRUFJMnTyY5OZmQkBB8fX3t61osFiIjI0lMTOSJJ54gISGBuLg48vLyOHjwILm5uSxduhSAvLw8Tpw4wblz5+jevTtWqxWAwYMHs3fv3jvqKM1ZgWEYWCyWEm01auhxhOqiOvV1kV+jAK4gmjRpws6dO9m/fz9ffvklo0aNYvbs2fj4+HD7cN2FhYUltqtVq5b958aNG9OqVSs+++wzEhISmDp16h2vExUVxYABAxg4cCBXr16lc+fOXLt2DcMwWLduHTVr1gTg4sWLeHl5sX79+hKv7+bmdtf6S3NW0KhRI7Kzs6lfvz4A2dnZtGzZ0qFtpfKrTn1d5NfotKOCWLt2LVOmTCEwMJDY2FgCAwP59ttvuf/++zlz5gwXLlzAMAy2bdv2q/sZNGgQ7777Ljdu3KBjx453/L5Bgwa0adOGGTNmEBUVBYCPjw/t2rVj1apVwK37ZUOHDuWTTz6he/fufPHFF/azk8TExHs+1h49erB+/XoAzp07x+eff87TTz99z/uVyqE69XWRX6MAriCee+45ioqK6NevHxEREVy9epXo6GiaN2/OkCFDiIyMZNCgQTz44IO/up+QkBBOnz7NwIEDf3GdgQMHkp6ezoABA+xtixYt4siRI4SHhzNw4EDCwsJ49tlnefTRR4mNjWXkyJFERERQUFBwz8c6YcIE8vLyCA0NJSYmhtjYWH73u9/d836lcqhOfV3k11g0HaGIiIjr6QxYRETEBApgEREREyiARURETKAAFhERMYECWERExARVZiCOCxeuUVysB7rFPFar72+vVE7U38VsruzvVZXOgEVEREygABYRETGBAlhERMQECmARERETKIBFRERMoAAWERExgQJYRETEBApgEREREyiARURETFBlRsKSys+3jjfeXh6l3i6/oJCrV/KdUJGIiPMogKXC8PbyYFjcmlJvt3bBcK6iABaRykWXoEVEREygABYRETGBAlhERMQECmARERETKIBFRERMoAAWERExgQJYRETEBApgEREREyiARURETKAAFhERMYECWERExAQKYBERERMogEVEREygABYRETGBAlhERMQECmARERETKIBFRERM4O7Mnb/55pts374dgODgYOLi4pgyZQppaWnUrFkTgPHjx9OzZ09SU1OZN28eBQUF9O3bl4kTJzqzNBEREVM5LYBTU1PZu3cviYmJWCwWRo8ezc6dOzl+/Dgffvgh/v7+9nXz8/OZOnUqq1evplGjRowdO5Y9e/YQHBzsrPJERERM5bRL0FarlcmTJ+Pp6YmHhwfNmjXjzJkznDlzhqlTpxIeHs6yZcsoLi7m6NGjNG3alCZNmuDu7k54eDgpKSnOKk1ERMR0TjsDbtGihf3njIwMtm/fzpo1azhw4AAzZ87E19eXsWPHsnHjRmrVqoXVarWv7+/vT1ZWVqler149n3KrXSofq9XX7BJcSv1dpPJz6j1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Zegz549y7hx41i0aBGhoaEAtG3blpMnT3Lq1CmKiopITk4mKCiIxo0b4+XlRVpaGgBJSUkEBQU5qzQRERHTOe0MeOXKlRQUFBAfH29vGzJkCPHx8UyYMIGCggKCg4Pp06cPAIsWLWL69Olcu3aNxx9/nBEjRjirNBEREdNZDMOoEtexdEmu8rNafRkWt6bU261dMFyXoEVcTJeg751GwhIRETGBAlhERMQECmARERETKIBFRERMoAAWERExgQJYRETEBApgEREREyiARURETKAAFhERMYECWERExAQKYBERERMogEVEREygABYRETGBAlhERMQECmARERETKIBFRKTS69Kli9kllJoCWERExAQKYBERqRRCQ0O5ePEiAIGBgezfvx+AF154gYKCAiZNmkTfvn2Ji4ujuLgYgAULFhAaGkr//v3517/+ZVrtd+NudgEiIiKO6Nq1K2lpaTz66KPYbDYOHTpE+/btycnJ4caNGwwfPpz27dszZMgQjh49yvnz5/nxxx/ZsmUL58+fZ+jQoWzZsgUfHx+zDwXQGbCIiFQS3bp148CBA6SlpTF06FAOHTrE4cOH6dixI76+vnTo0AGLxcJDDz3E5cuX+eqrrwgNDcXNzY0GDRrQqlUrTpw4YfZh2DkUwFlZWXe0/fDDD+VejIiIyC/p3Lkzhw8fJi0tjbCwMM6dO0dqaiqBgYG4ubmVWNcwDIqKin6zzUy/GsCXL1/m8uXLvPjii+Tm5tqXz58/z/jx411Vo4iICD4+Pnh7e/Ptt9/y8MMP06JFCxITEwkICLjr+r///e/Ztm0bxcXFZGVlceTIER577DEXV/3LfvUe8KRJk/jiiy+Ako94u7u707t3b+dWJiIi8h+6dOnCN998g8VioWPHjpw7d+4X7+n26tWLr7/+mmeffRaAGTNmUKdOHVeW+6sshmEYv7XSlClTmDdvnivqKbMLF65RXPybhyIVmNXqy7C4NaXebu2C4eTkXHVCRaVjtfq67LXU38VsruzvVZVDT0HPmzeP06dPk5uby+15/fjjjzutMBERkarMoQBetmwZK1eupF69evY2i8XCJ5984rTCREREqjKHAnjz5s3s2LGDBg0aOLseERGRasGhryE1atRI4Ss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bTYbAJ6eniXab58/GOD69etERUWRmZlJp06diI6OLvH7e5lDWAEsIiKVnru7O23atGH16tV07tyZgIAA3n77bYKDgwkICGDbtm3k5+djs9nYtGkTAQEBDu03IyMDi8XCSy+9RJcuXdi5cydFRUXlU3O57EVERMRkwcHBHDx4kGbNmmG1Wrlw4QJPPfUU7du3Jz09ncjISGw2G4GBgTz//POcO3fuN/fZsmVLHnvsMftQzIGBgaSlpZVLvQ7NB1wZaH7Uyk/zATtO/V3Mdrf+XmwrpIa7R7m/lrP2azZdghYRkXLhrJCsiuELCmARERFTKIBFRERMoAAWERExgQJYRETEBApgEREREyiARUSkXNx00rSB97Lf6Oho9u/ff0f70qVL+eSTT8jMzCQkJOSu2z766KNlfl1HaCAOEREpF57uHsSserXc9/v+qNJNcuCIV1+9VWdmZma579tRCmAREakSDMNg0aJF7Nq1Czc3NwYPHgzAxo0biY+P58qVK0ybNo2QkBAmT55M586d6dy5s337zMxMYmNjycvLo23btk6v16mXoK9du0ZYWJj9E0Zqairh4eH06tWLJUuW2NdLT08nIiKC3r17M23aNPsg2SIiIo5KSUnh0KFDbN26lX/+858kJCSQk5ODr68viYmJTJ8+neXLl//i9nPmzCEiIoKkpCQ6dOjg9HqdFsBHjhxh6NChZGRkAJCfn8/UqVP529/+xkcffcTx48fZs2cPALGxscyYMYOPP/4YwzDYsGGDs8oSEZEq6uDBg/Tt2xdPT09q165NUlISVquVZ555BoDmzZtz6dKlX9z+wIED9O3bF4Bnn30WDw/njsDltADesGEDM2fOxN/fH4CjR4/StGlTmjRpgru7O+Hh4aSkpHD69Gny8/Np164dABEREaSkpDirLBERqaLc3d1LTAuYmZlJXl6efYpBR6YM/Hl6BIvFQo0azn1O2Wl7f/311/n9739vX87OzsZqtdqX/f39ycrKuqPdarWSlZXlrLJERKSK6tSpEzt27KCwsJAbN24wevToUuVJt27d2LJlCwA7duygoKDAWaUCLnwIq7i4uMSnD8MwsFgsv9heWvXq+ZRLnVI5uXImoopA/V3kTj179uT48eNER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2bDcMwjJs3bxphYWFGSkqKcebMGaNDhw5GQUGBYRiGsXLlSmPnzp2/2C5SEai/S2WlM+AqaN++fQQGBtKoUSMAYmJieOyxx5gzZw4AsbGxfPHFF7z77rtkZGSQnZ1NXl4eDRo0oGXLlgwYMICgoCCCgoLo2rUrxcXFd20XqQjU36WyUgBXQW5ubiVmgMnPz+fHH3+0L//P//wPRUVF9O3bl6eeeoqzZ89iGAY1atTgww8/5NixY+zbt4+5c+fy5JNPEhcX94vtImZTf5fKSg9hVUFdunRh3759ZGdnA7Bu3ToWLlxo//3evXsZN24c/fr1A+DIkSMUFRVx4sQJwsLCaNasGWPHjiUmJoZjx479YrtIRaD+LpWVzoCroEcffZTY2FhGjx4NgNVqZdasWbzzzjsATJw4kXHjxlGrVi18fHzo1KkTP/30EwMHDqRv375ERkZSq1YtvL29mT59Oi1btrxru0hFoP4ulZVmQxIRETGBLkGLiIiYQAEsIiJiAgWwiIiICRTAIiIiJlAAi4iImEABLCIiYgIFsIiIiAkUwCIiIib4f6j8ofLmTgt2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 478.425x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例5：使用catplot()来实现countplot()的统计效果，必须设置kind=\"count\"\n",
    "当要对其他分类变量进行分组时，使用catplot()比直接使用FacetGrid更加安全\n",
    "\"\"\"\n",
    "sns.catplot(x=\"class\", hue=\"who\", col=\"survived\",\n",
    "            data=titanic, kind=\"count\",\n",
    "            height=4, aspect=.7);\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEPCAYAAAC+35gCAAAAB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2THPnztXAgQM1cODAwPplZWVKT0/XlStX1KdPn8Z6Go2G3VON7PDhw1qwYIE2bNigN954Q61bt9bGjRvVtWtXbd26Vdu3b9fatWuVl5enoUOHXvc9Iy1bttT69euVmpqq1157rRGfxe0pPj5e+/Z9fqK9Tz75RIcOHZIkvfPOOxo6dKh27typDRs2KCcnR6dOndKbb74pSfr44481bdo05ebm6tChQyovL9e6dev02GOPad26dfL7/XrzzTe1atUqbd68WVOnTtXrr78eeNza2lqtW7dOv/3tb7V8+fKGf+K3OY/Ho0OHDmnLli166623tHHjRvl8Pt11113KyclRZmamVqxY8Y3rv/zyy0pJSVFubq769+/fgJOHB6LRyO6//361b99ezZo1U6tWrRQbGytJ+vGPf6yLFy9q6dKl2rp1q5YuXaq3335bV65cCaz7yCOPSJK6dOmi8+fPN8r8t7MvonHixAl17txZERERqqys1O7du/Xhhx9q9OjRatasmaKiojRu3LhAYH70ox/pgQceUEREhNq1a3fDaxoREaEVK1Zoz549Wr58uXJycnT58uXA4/K6OuvAgQNKSkpS06ZN1bx5c+Xm5srlcmn48OGSpM6dO+vcuXPfuP7+/fuVlJQkSXr88cfVpEmTBpk7XBCNRvbVf+EiIyMDfz99+rQmTJigS5cuKS4uTmPHjtWXf4E/OjpakjgbsEP69eunY8eOqaioSAMHDtSAAQPk8XhUV1enu++++4bb19XVSZKaNm163fIvv6aSdPnyZY0fP15lZWUaMGCAJk+efN31vK7OioqKum7blpWV6cqVK4HXyWS7f/HfoWVZioi4s/43emc92++ZDz/8UDExMZoyZYp69eql7du3q76+vrHHumNERUWpd+/eWrt2rQYOHKjBgwdr1apVio+P1+DBg7V161ZVV1errq5OGzZs0ODBg43ut7S0VJZlafr06Ro0aJD++c9/8ro2oAEDBqiwsFC1tbW6evWqpk6dKq/Xa7z+kCFDtHnzZklSYWGhampqnBo1LHEgPIw9/PDDOnbsmEaNGiXbtjVgwAAdP368sce6o8THx+vAgQPq1KmTXC6XKisrNXToUPXr109Hjx7VuHHjVFdXp4cffliTJk3S//73v2+9z27duql79+5KSkqSZVl6+OGHVVxc3ADPBpI0YsQIlZSUKCUlRX6/X2lpadq2bZvx+vPnz1d6errWrVunnj17qnnzm38B3O2GExYCAIyxewoAYIxoAACMEQ0AgDGiAQAwRjQAAMaIBuCAuXPnavXq1Y09BnDLEQ0AgDGiAYTgiSeeCJxrKi8vT7169VJ1dbUkKSMjQ7t379b777+v1NRUDR8+XDNmzAicN+zgwYN68sknlZycrJSUFO3evbvRngcQLKIBhGDEiBGB/9m/8847+uEPf6iDBw/Ktm3t2rVL3bt3l9fr1Zo1a1RQUCCv16vCwkKdO3dOs2bNUkZGhrZs2aJFixYpPT1d//nPfxr5GQFmiAYQgi+iYdu2Dh48qClTpmjv3r364IMPdO+99wbOmtqsWTNFRkaqS5cuOnv2rI4cOaJ777038D0MXbp0Uf/+/bV///5GfkaAGaIBhKBr166qra3Vjh079JOf/ESPPvqo9u7dq507dyohIUHS5yc8/IJlWbJtW/X19TecRdW27cAZcoFwRzSAEA0fPlxLly7VQw89pE6dOqmqqkpbtmzRyJEjv3Gdvn376rPPPtORI0ckScePH9eBAweu+2Y4IJxxllsgRCNGjNDq1as1ZMgQSZ+fMvvjjz9W+/btv3Gd1q1ba/ny5Xr55ZdVXV0ty7KUlZWln/70pw01NvCdcJZbAIAxdk8BAIwRDQCAMaIBADBGNAAAxogGAMAY0QAAGCMaAABjRAMAYOz/AF5idpGMlRslAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "sns.set(style=\"darkgrid\")\n",
    "# 获取数据\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\"\"\"\n",
    "案例6： 绘制空心的直方图\n",
    "\"\"\"\n",
    "sns.countplot(x=\"who\", data=titanic,\n",
    "              facecolor=(0, 0, 0, 0),\n",
    "              linewidth=5,\n",
    "              edgecolor=sns.color_palette(\"dark\", 3))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "整理制作：数据挖掘分析可视化学研社：\n",
    "\n",
    "<div>\n",
    "<table align=\"left\" border=\"1\" bordercolor=\"#000000\">\n",
    "    <div>\n",
    "    <tr>\n",
    "        <td>\n",
    "            微信公众号：数据挖掘分析可视化学研社<br>\n",
    "            <img src=\"../image/visual.jpg\" width=\"150\" height=\"150\" align=\"left\"/>    \n",
    "        </td>\n",
    "    </tr>\n",
    "    </div>\n",
    "    <div>\n",
    "     <tr>\n",
    "        <td>\n",
    "        配置环境：python 3.4+  \n",
    "        </td>\n",
    "    </tr>\n",
    "        </div>\n",
    "</table>\n",
    "</div>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
